classdef mycvpartition < cvpartition
      
    methods              
        function trainIndices = training(cv,varargin)
        %TRAINING Training set for a cross-validation partition.
        %   TRIDX = TRAINING(C) returns a logical vector TRIDX that selects
        %   the observations in the training set for the hold-out
        %   cross-validation partition C.  C may also be a partition for
        %   resubstitution, in which case TRIDX is a logical vector that
        %   selects all observations.
        %
        %   TRIDX = TRAINING(C,I) returns a logical vector TRIDX that selects
        %   the observations in the I-th training set for a K-fold or
        %   leave-one-out cross-validation partition C.  In K-fold
        %   cross-validation, C divides a data set into K disjoint folds with
        %   roughly equal size.  The I-th training set consists of all
        %   observations not contained in the I-th fold.  In leave-one-out
        %   cross-validation, the I-th training set consists of the entire
        %   data set except the I-th observation.
        %
        %   See also CVPARTITION, CVPARTITION/TEST.
%         trainIndices = training(cv.Impl,varargin{:});
        
        i = varargin{:};        
        trai2 = true(24, 1);
        trai2(i) = false;
        trai2(12 + i) = false;
        trainIndices = trai2;
        end

        function testIndices = test(cv,varargin)
        %TEST Test set for a cross-validation partition.
        %   TEIDX = TEST(C) returns a logical vector TEIDX that selects the
        %   observations in the test set for the hold-out cross-validation
        %   partition C.  C may also be a partition for resubstitution, in
        %   which case TEIDX is a logical vector that selects all
        %   observations.
        %
        %   TEIDX = TEST(C,I) returns a logical vector TEIDX that selects the
        %   observations in the I-th test set for a K-fold or leave-one-out
        %   cross-validation partition C.  In K-fold cross-validation, C
        %   divides a data set into K disjoint folds with roughly equal size.
        %   The I-th test set consists of the I-th fold.  In leave-one-out
        %   cross-validation, the I-th test set consists of the I-th
        %   observation.
        %
        %   See also CVPARTITION, CVPARTITION/TRAINING.
%         testIndices = test(cv.Impl,varargin{:});
        i = varargin{:};        
        trai2 = true(24, 1);
        trai2(i) = false;
        trai2(12 + i) = false;
        testIndices = ~trai2;
        end

        % Display methods
%         function display(cv)
%             objectname = inputname(1);
%             display(cv.Impl,objectname)
%         end
        function disp(cv)
            disp(cv.Impl)
        end
    end % public methods block
end % classdef

